class Animal {
  public name: string;
  protected constructor(name: string) {
    this.name = name
  }
  public move(distance: number = 0) {
    console.log(`${this.name}已经走了${distance}`)
  }
}

class Dog extends Animal {
  constructor(name) {
    super(name)
  }
  public move(distance: number = 0) {
    super.move(distance)
  }
}

const smallDog = new Dog('小花狗')
smallDog.move(40)

function alertAnimal(name: string = '小黄', age: number = 10) {
  console.log(`${name}已经${age}岁了`)
}

alertAnimal()
